import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

/* 要写了meta导航菜单才会有，若只有单个路由且有children，meta必须写在children中导航菜单才有 */
// 用来动态添加
export const asyncRoutes: RouteRecordRaw[] = [];

// 基本路由
export const constantRoutes: Array<RouteRecordRaw> = [
	{
		path: '/',
		redirect: '/login',
		meta: { hidden: true },
	},
	{
		path: '/login',
		meta: { hidden: true },
		children: [
			{
				path: '/login',
				name: 'login',
				meta: { hidden: true },
				component: () => import('@renderer/views/login/index.vue'),
			},
		],
	},
	// 404 page must be placed at the end !!!
	{
		path: '/:pathMatch(.*)*',
		component: () => import('@renderer/views/404.vue'),
		meta: { hidden: true },
	},
];

const router = createRouter({
	history: createWebHashHistory(),
	routes: constantRoutes,
});

export default router;
